home *** CD-ROM | disk | FTP | other *** search
/ Mac Action 1996 January / mac-action-07.iso / mac / Inside Action / Total Distortion Big Demo / zRad.Dxr / 00047_RadioMan.script.ls < prev    next >
Encoding:
Text File  |  1995-06-05  |  3.7 KB  |  142 lines

  1. property RadioMegaLST, TankFLoopLST, EdgeFLoopLST, FLoopChanLST, PlayRadioSndChan, FishChan, NowRadioChan, PlayPosLST, TankBlnkCstNum, TankStartCstNum, TankEndCstNum, EdgeBlnkCstNum, EdgeStartCstNum, EdgeEndCstNum, RadioSndPath
  2.  
  3. on birth me
  4.   set RadioSndPath to "@:zRadAIFF:"
  5.   set RadioMegaLST to [:]
  6.   set LST1 to value(field "RadioPlayList1")
  7.   addProp(RadioMegaLST, 1, LST1)
  8.   set LST2 to value(field "RadioPlayList2")
  9.   addProp(RadioMegaLST, 2, LST2)
  10.   set LST3 to value(field "RadioPlayList3")
  11.   addProp(RadioMegaLST, 3, LST3)
  12.   set LST4 to value(field "RadioPlayList4")
  13.   addProp(RadioMegaLST, 4, LST4)
  14.   set LST5 to value(field "RadioPlayList5")
  15.   addProp(RadioMegaLST, 5, LST5)
  16.   set PlayRadioSndChan to 1
  17.   set NowRadioChan to 1
  18.   set PlayPosLST to [1, 1, 1, 1, 1]
  19.   set FishChan to 9
  20.   puppetSprite(FishChan, 1)
  21.   set FLoopChanLST to [11, 12, 13, 14, 15, 16, 17]
  22.   repeat with x in FLoopChanLST
  23.     puppetSprite(x, 1)
  24.   end repeat
  25.   set EdgeBlnkCstNum to the number of cast "EdgeVids.BLANK"
  26.   set EdgeStartCstNum to EdgeBlnkCstNum + 1
  27.   set EdgeEndCstNum to the number of cast "EdgeVids.End"
  28.   set TankBlnkCstNum to the number of cast "tankVids.BLANK"
  29.   set TankStartCstNum to TankBlnkCstNum + 1
  30.   set TankEndCstNum to the number of cast "TankVids.END"
  31.   BuildTankList(me)
  32.   BuildEdgeList(me)
  33.   return me
  34. end
  35.  
  36. on PlayRad me, StationNum
  37.   set pos to getAt(PlayPosLST, StationNum)
  38.   set PlayLST to getProp(RadioMegaLST, StationNum)
  39.   set SndFile to getAt(PlayLST, pos)
  40.   sound playFile PlayRadioSndChan, RadioSndPath & SndFile
  41.   set MaxPos to count(PlayLST)
  42.   if pos = MaxPos then
  43.     set pos to 1
  44.   else
  45.     set pos to pos + 1
  46.   end if
  47.   setAt(PlayPosLST, StationNum, pos)
  48. end
  49.  
  50. on NextShow me, StationNum
  51.   if the soundBusy of PlayRadioSndChan then
  52.     exit
  53.   else
  54.     PlayRad(me, StationNum)
  55.   end if
  56. end
  57.  
  58. on BuildTankList me
  59.   set TankFLoopLST to []
  60.   repeat with x = TankStartCstNum to TankEndCstNum
  61.     add(TankFLoopLST, x)
  62.   end repeat
  63. end
  64.  
  65. on BuildEdgeList me
  66.   set EdgeFLoopLST to []
  67.   repeat with x = EdgeStartCstNum to EdgeEndCstNum
  68.     add(EdgeFLoopLST, x)
  69.   end repeat
  70. end
  71.  
  72. on ClikTankLoop me, num
  73.   set chan to getAt(FLoopChanLST, num)
  74.   if the optionDown then
  75.     set cst to the castNum of sprite chan
  76.     repeat with x in FLoopChanLST
  77.       set the castNum of sprite x to cst
  78.     end repeat
  79.     exit
  80.   end if
  81.   if the commandDown then
  82.     KwikEdge(me, chan)
  83.     exit
  84.   end if
  85.   if the controlDown then
  86.     set the castNum of sprite chan to TankBlnkCstNum
  87.     exit
  88.   end if
  89.   if count(TankFLoopLST) < 2 then
  90.     BuildTankList(me)
  91.   end if
  92.   set RandCNT to count(TankFLoopLST)
  93.   set n to random(RandCNT)
  94.   set the castNum of sprite chan to getAt(TankFLoopLST, n)
  95.   deleteAt(TankFLoopLST, n)
  96. end
  97.  
  98. on KwikTank me, chan
  99.   if count(TankFLoopLST) < 2 then
  100.     BuildTankList(me)
  101.   end if
  102.   set RandCNT to count(TankFLoopLST)
  103.   set n to random(RandCNT)
  104.   set the castNum of sprite chan to getAt(TankFLoopLST, n)
  105. end
  106.  
  107. on KwikEdge me, chan
  108.   if count(EdgeFLoopLST) < 2 then
  109.     BuildEdgeList(me)
  110.   end if
  111.   set RandCNT to count(EdgeFLoopLST)
  112.   set n to random(RandCNT)
  113.   set the castNum of sprite chan to getAt(EdgeFLoopLST, n)
  114. end
  115.  
  116. on ClikEdgeLoop me, num
  117.   set the castNum of sprite FishChan to TankBlnkCstNum
  118.   set chan to getAt(FLoopChanLST, num)
  119.   if the optionDown then
  120.     set cst to the castNum of sprite chan
  121.     repeat with x in FLoopChanLST
  122.       set the castNum of sprite x to cst
  123.     end repeat
  124.     exit
  125.   end if
  126.   if the commandDown then
  127.     KwikTank(me, chan)
  128.     exit
  129.   end if
  130.   if the controlDown then
  131.     set the castNum of sprite chan to TankBlnkCstNum
  132.     exit
  133.   end if
  134.   if count(EdgeFLoopLST) < 2 then
  135.     BuildEdgeList(me)
  136.   end if
  137.   set RandCNT to count(EdgeFLoopLST)
  138.   set n to random(RandCNT)
  139.   set the castNum of sprite chan to getAt(EdgeFLoopLST, n)
  140.   deleteAt(EdgeFLoopLST, n)
  141. end
  142.